home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / vmed.arc / ED6.CCC < prev    next >
Encoding:
Text File  |  1985-12-03  |  1.8 KB  |  105 lines

  1. /*    Screen editor:    terminal output module
  2.  *
  3.  *    Module: ed6/ccc
  4.  *    Date: November 15, 1983
  5.  *    Changed: February 17, 1984
  6.  */
  7.  
  8. #include ed0
  9.  
  10. /* data global to this module */
  11.  
  12. /* Cursor location saves */
  13. char    outx;    /* column position */
  14. char    outy;    /* row position */
  15.  
  16. /* Return the current coordinates of the cursor. */
  17. outgetx()
  18. {    return(outx);    }
  19.  
  20. outgety()
  21. {    return(outy);    }
  22.  
  23. /* Output one printable character to the screen. */
  24. outchar(c)    char c;
  25. {    if (c < ' ') {
  26.         syscout(c);
  27.         if (c == 8 && outx)
  28.             --outx;
  29.         else if (c == 13 | c == 10)    {
  30.             outx=0;
  31.             ++outy;
  32.         }
  33.     }
  34.     else if (outx < SCRNW1) {
  35.         syscout(c);
  36.         ++outx;
  37.     }
  38.     else    {
  39.         syscout(8);
  40.         syscout(c);
  41.         return(ERR);
  42.     }
  43.     return(c);
  44. }
  45.  
  46. /* Position cursor to position x,y on screen.
  47.  * 0,0 is the top left corner.
  48.  */
  49. outxy(x,y)    char x,y;
  50. {    outx = x;
  51.     outy = y;
  52.     setcur(x,y);
  53. }
  54.  
  55. /* Erase the entire screen.
  56.  * Make sure the rightmost column is erased.
  57.  */
  58. outclr()
  59. {    outxy(0,0);
  60.     syscout(0x1F);
  61. }
  62.  
  63. /* Delete the line on which the cursor rests.
  64.  * Leave the cursor at the left margin.
  65.  */
  66. outdelln()
  67. {    outxy(0,outy);
  68.     outdeol();
  69. }
  70.  
  71. /* Delete to end of line.
  72.  * Assume the last column is blank.
  73.  */
  74. outdeol()
  75. {    syscout(0x1E);    }
  76.  
  77. /* Return yes if terminal has hardware scroll. */
  78. outhasup()
  79. {    return(NO);    }
  80.  
  81. outhasdn()
  82. {    return(NO);    }
  83.  
  84. /* Scroll the screen up.
  85.  * Assume the cursor is on the bottom line.
  86.  */
  87. outsup()
  88. {
  89.     /* auto scroll */
  90.     outxy(0,SCRNL1);
  91.     syscout(10);
  92. }
  93.  
  94. /* Scroll screen down.
  95.  * Assume the cursor is on the top line.
  96.  */
  97. outsdn()
  98. {
  99.     /* auto scroll */
  100.     outxy(0,0);
  101.     syscout(11);
  102. }
  103.  
  104. /* end module ed6/ccc */
  105.